﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Runda.CMS.Bll;
using Runda.CMS.Common.Utility;
using Runda.CMS.Common.Entity;
using System.Data;

namespace Runda.CMS.Portal.Mobile
{
    public partial class MaintainList : BasePage
    {
        private String sql = "select * from (select a.RegisterID,a.PerformPerson,a.TaskType,a.TaskStatus,a.ExpectEndDate,a.CustomerID,a.InstrumentID,a.InstrumentSerialNum,b.CustomerName,c.instrumentName from Cms_Wsm_TaskRegister as a inner join Cms_Ctrt_Customer as b on b.CustomerID = a.CustomerID inner join Cms_Wsm_InstrumentInfo as c on c.InstrumentID = a.InstrumentID) as a where 1=1";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindList();
            }
        }
        private void BindList()
        {
            sql = sql + " and (TaskType = 2 or TaskType=9) and TaskStatus = 0 and convert(char(10),ExpectEndDate,121)>='" + System.DateTime.Now.ToString("yyyy-MM-dd") + "' order by ExpectEndDate asc";

            DataTable list = new CommonBll().getDataFromSQL(sql);

            myWorkRegisterList.DataSource = list;
            myWorkRegisterList.DataBind();

        }
    }
}
